﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RedfieldWeather
{
	public partial class Forecast : System.Web.UI.Page
	{
		private RFW.Weather.Forecast.Forecast _forecast = new RFW.Weather.Forecast.Forecast();

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!this.IsPostBack)
				LoadData();
		}

		private void LoadData()
		{
			_forecast.DownloadComplete += new EventHandler(_forecast_DownloadComplete);
			_forecast.Get();
		}

		void _forecast_DownloadComplete(object sender, EventArgs e)
		{
			rptForecast.DataSource = _forecast.Days;
			rptForecast.DataBind();
		}
	}
}